Rename Module Name

Hi Team,

I have created a formal module, where I need to rename that module as per user's input.

I have write a code for same, but that is not updating.

I am getting below error :

-E- DXL: <Line:752> incorrect arguments for function (rename)
-E- DXL: <Line:754> incorrect arguments for (.)
-E- DXL: <Line:754> incorrectly concatenated tokens
-E- DXL: <Line:753> incorrect arguments for (=)
-I- DXL: All done. Errors reported: 4. Warnings reported: 0.

 

Kindly help me out.

 

string NameFull = "FS-Goal Module"

string descriptionOfFGoals = "Description of FS-Goal Module"
int iAbsNoStart = 1
   
current = fCurrent
Module modCreated = create(NameFull, descriptionOfFGoals, iAbsNoStart, true)
save (modCreated)
close (modCreated)
 
string srename = "FS-Goal-" sFSOINo ""
rename(NameFull, srename)
string mRname = edit(srename, false)
mRname."Prefix" = "FS-Goal-" sFSOINo

Rahij - Thu Jan 18 11:09:13 EST 2018

Re: Rename Module Name
Mike.Scharnow - Thu Jan 18 11:38:01 EST 2018

Hello Rahij,

from the DXL manual, https://www.ibm.com/support/knowledgecenter/SSYQBZ_9.6.1/com.ibm.doors.requirements.doc/topics/dxl_reference_manual.pdf, page 276: 

string rename({Item i|Folder f|Project p|ModName_ modRef}, string name, string description)

Operation

Renames the item specified by the first argument to name and associates it with description. The name argument must be an unqualified name. If the user does not have modify access to the item, the call fails. The first form returns a null string on success; otherwise, an error message.

Example

rename(folder "my folder", "public", "for review")

 

So,, these lines should work (did not test this)

 

string result = rename (item NameFull, srename, descriptionOfGoals)
if (!null result) {
    warningBox "An error occurred: " result
}

 

Re: Rename Module Name
Mike.Scharnow - Thu Jan 18 11:42:42 EST 2018

oh, there are more problems, sorry for not having seen them.

the edit command does not return a string but a Module (see page 300 of DXL reference manual)

WIth this change, the assignment to the Prefix should also work.

Don't forget to save and close the module.

 

Hope this helps,
Regards,
Mike

Re: Rename Module Name
XiaoXingLu - Thu Jan 18 23:06:30 EST 2018

Please try the code like:

----------------------------------------------

string NameFull = "FS-Goal Module3"
string descriptionOfFGoals = "Description of FS-Goal Module3"
int iAbsNoStart = 1
   

Module modCreated = create(NameFull, descriptionOfFGoals, iAbsNoStart, true)
save (modCreated)

close (modCreated)
ModName_ mr=module(modCreated)
rename(mr, "FS-Goal Module30", "description")

----------------------------------------------

Hope it helps.

Re: Rename Module Name
Rahij - Thu Jan 18 23:08:36 EST 2018

Mike.Scharnow - Thu Jan 18 11:42:42 EST 2018

oh, there are more problems, sorry for not having seen them.

the edit command does not return a string but a Module (see page 300 of DXL reference manual)

WIth this change, the assignment to the Prefix should also work.

Don't forget to save and close the module.

 

Hope this helps,
Regards,
Mike

Hi Mike,

As per your inputs, that's working fine.

Thank you so much for help.

 

Regards,

Rahij